# 以覆盖的方式往文件中写入数据
with open('data_files/pi_digits.txt', 'w') as file_object:
    file_object.write('圆周率')

#以非覆盖的方式往文件中添加数据
with open('data_files/pi_digits.txt', 'a') as file_object:
    file_object.write('\n3.14159265358979323846')